/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						       direct_surface_16.h

	$Header: /game/direct_surface_16.h $

	$NoKeywords: $

 ************************************************************************/

#ifndef DIRECT_SURFACE_16_H_INCLUDED
#define DIRECT_SURFACE_16_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "abstract_bitmap.h"
#include "uncopyable.h"

// -------------------------------------------------------
// 16 bit direct draw surface
// -------------------------------------------------------
struct IDirectDraw7;
struct IDirectDrawSurface7;

class t_direct_surface_16 : private t_uncopyable
{
public:
	t_direct_surface_16( int width, int height, IDirectDraw7* direct_draw,
		                 int red_mask, int green_mask, int blue_mask );
	virtual ~t_direct_surface_16();

	int                  get_height() const;
	int                  get_width() const;
	IDirectDrawSurface7* get_surface();
public:
	int                  m_width;
	int                  m_height;
	IDirectDrawSurface7* m_surface;
};

// -------------------------------------------------------
// inlines for 16 bit direct draw surface
// -------------------------------------------------------
inline IDirectDrawSurface7* t_direct_surface_16::get_surface()
{
	return m_surface;
}

inline int t_direct_surface_16::get_height() const
{
	return m_height;
}

inline int t_direct_surface_16::get_width() const
{
	return m_width;
}

// -------------------------------------------------------
// 16 bit direct draw surface adaptor
// -------------------------------------------------------
class t_surface_adaptor_16 : public t_abstract_bitmap16
{
public:
	t_surface_adaptor_16( IDirectDrawSurface7* surface, t_screen_point size );
	virtual ~t_surface_adaptor_16();
protected:
	IDirectDrawSurface7* m_surface;
};

// utility function: gets direct draw object from surface
IDirectDraw7* get_direct_draw( IDirectDrawSurface7* surface );

#endif // DIRECT_SURFACE_16_H_INCLUDED